<?php session_start();

if($_SESSION['ultimaAcaoMinhaConta'] != "REMOVERNOTICIA") {
    unset($_SESSION["menssagemErro"]);
}

$menssagemErro = $_SESSION["menssagemErro"];
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="/Esquina_da_TI/default.css" rel="stylesheet" type="text/css" media="screen" />
        <script type="text/javascript" src="formulario.js"></script>
        <script type="text/javascript" src="../js/calendar1.js"></script>
        <title>Alteração Noticia</title>
    </head>
    <body>
        <center>

            <h1>Alteração de Noticia</h1>
            <form id="formularioRemoverNoticia" name="formularioRemoverNoticia" method="POST" action="ControleRemoverNoticia.php">
                <table cellspacing="1" cellpadding="1">
                    <tr>
                        <td class="head" colspan="2">Selecionar Noticia a Remover</td>
                    </tr>
                    <tr>
                        <th>Oportunidades Atuais:</th>
                        <td>
                            <select name="noticia">
                                <option>Selecione uma Noticia</option>
                                <?php
                                require_once($_SERVER["DOCUMENT_ROOT"] . '/Esquina_da_TI/DAO/Conexao.php');

                                $conexao = new Conexao();

                                $conexao->abrirConexao();

                                $noticia = $_POST['noticia'];

                                $sql = "SELECT * FROM noticia";
                                $qr = mysql_query($sql) or die(mysql_error());

                                while(
                                $ln = mysql_fetch_assoc($qr)) {
                                    echo '<option value="'.$ln['codNoticia'].'">'.$ln['titulo'].'</option>';
                                }

                                $conexao->fecharConexao();

                                ?>
                            </select>
                        </td>
                    </tr>
                    <tr><td colspan="2">&nbsp;</td></tr>
                    <tr><td colspan="2" align="center">
                            <?php

                            require_once($_SERVER["DOCUMENT_ROOT"] . '/Esquina_da_TI/Gui/Fachada.php');

                            $fachada = new Fachada();
                            $fachada->exibirMenssagemErro($menssagemErro);
                            ?>
                        </td></tr>
                    <tr><td colspan="2">&nbsp;</td></tr>
                    <tr>
                        <td colspan="2" align="center">
                            <input type="submit" value="Remover" name="removerNoticia" />
                        </td>
                    </tr>
                </table>
            </form>
        </center>
    </body>
</html>
